<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>emacps: xemacps_ieee1588.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">emacps
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xemacps__ieee1588_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xemacps_ieee1588.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file implements the following functionalities. </p>
<ul>
<li>Contains a routine upon reception of Tx done ISR to store the time stamp of the transmitted packet.</li>
<li>Does formatting and initiates a Tx for Announce frame, Sync frame, FollowUp frame, PDelayReq, PDelayResp and PDelayRespFollowUp frames.</li>
<li>Decodes and processes the received PTP frames of type Sync Frame, FollowUp frame, Announce Frame, PDelayReq frame, PDelayResp frame and PDelayRespFollowUp frame.</li>
<li>Implements the best master clock algorithm.</li>
<li>Contains function that calculates the link delay from existing data.</li>
<li>Contains function that calculates the clock offset from existing data and applies the clock offset to correct the PTP clock.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

1.00a asa  09/16/11 First release based on the AVB driver.
1.01a asa  03/03/12 Support for Zynq is added.
3.3   asa  05/19/16 Removed code specific to PEEP.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a24b724fc0f49b35cb48284662f47ff38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a24b724fc0f49b35cb48284662f47ff38">XEmacPs_PtpTxDoFurtherProcessing</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a24b724fc0f49b35cb48284662f47ff38"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is invoked from the TxDone callback.  <a href="#a24b724fc0f49b35cb48284662f47ff38">More...</a><br /></td></tr>
<tr class="separator:a24b724fc0f49b35cb48284662f47ff38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9f6dd2305bed120624b1c3cdfff2212"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#ab9f6dd2305bed120624b1c3cdfff2212">XEmacPs_MasterSendAnnounce</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:ab9f6dd2305bed120624b1c3cdfff2212"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP Announce Packet.  <a href="#ab9f6dd2305bed120624b1c3cdfff2212">More...</a><br /></td></tr>
<tr class="separator:ab9f6dd2305bed120624b1c3cdfff2212"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e54e6fc47b0af0a0a3bae8a6e0c0616"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a3e54e6fc47b0af0a0a3bae8a6e0c0616">XEmacPs_MasterSendSync</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a3e54e6fc47b0af0a0a3bae8a6e0c0616"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP SYNC Packet.  <a href="#a3e54e6fc47b0af0a0a3bae8a6e0c0616">More...</a><br /></td></tr>
<tr class="separator:a3e54e6fc47b0af0a0a3bae8a6e0c0616"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56825a59cb3c1c705cb41d9da915ee88"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a56825a59cb3c1c705cb41d9da915ee88">XEmacPs_MasterSendFollowUp</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a56825a59cb3c1c705cb41d9da915ee88"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP FOLLOWUP Packet.  <a href="#a56825a59cb3c1c705cb41d9da915ee88">More...</a><br /></td></tr>
<tr class="separator:a56825a59cb3c1c705cb41d9da915ee88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a493b403b2f9babe7778c9ef4f37dbe54"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a493b403b2f9babe7778c9ef4f37dbe54">XEmacPs_SendPDelayReq</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a493b403b2f9babe7778c9ef4f37dbe54"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP PDelayReq Packet.  <a href="#a493b403b2f9babe7778c9ef4f37dbe54">More...</a><br /></td></tr>
<tr class="separator:a493b403b2f9babe7778c9ef4f37dbe54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d4609324a39c5ef322d3fa14d4e6bd8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a1d4609324a39c5ef322d3fa14d4e6bd8">XEmacPs_SendPDelayResp</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a1d4609324a39c5ef322d3fa14d4e6bd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP PDelayResp Packet.  <a href="#a1d4609324a39c5ef322d3fa14d4e6bd8">More...</a><br /></td></tr>
<tr class="separator:a1d4609324a39c5ef322d3fa14d4e6bd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b2dafd9729d2c3e6c0d8fbe63e16ff9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a2b2dafd9729d2c3e6c0d8fbe63e16ff9">XEmacPs_SendPDelayRespFollowUp</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a2b2dafd9729d2c3e6c0d8fbe63e16ff9"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to format and then initiate the Tx of a PTP PDelayRespFollowUp Packet.  <a href="#a2b2dafd9729d2c3e6c0d8fbe63e16ff9">More...</a><br /></td></tr>
<tr class="separator:a2b2dafd9729d2c3e6c0d8fbe63e16ff9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52690e55087c8f5cb908d111c7431552"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a52690e55087c8f5cb908d111c7431552">XEmacPs_DecodeRxSync</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a52690e55087c8f5cb908d111c7431552"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to decode a received PTP Sync Packet.  <a href="#a52690e55087c8f5cb908d111c7431552">More...</a><br /></td></tr>
<tr class="separator:a52690e55087c8f5cb908d111c7431552"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a696297bb61249e62e6901699128548c6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a696297bb61249e62e6901699128548c6">XEmacPs_DecodeRxFollowUp</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a696297bb61249e62e6901699128548c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to decode a received PTP FollowUp Packet.  <a href="#a696297bb61249e62e6901699128548c6">More...</a><br /></td></tr>
<tr class="separator:a696297bb61249e62e6901699128548c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82e295146b0eeddea22bae58249aa7df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a82e295146b0eeddea22bae58249aa7df">XEmacPs_DecodeRxPDelayResp</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a82e295146b0eeddea22bae58249aa7df"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to decode a received PTP PDelayResp Packet.  <a href="#a82e295146b0eeddea22bae58249aa7df">More...</a><br /></td></tr>
<tr class="separator:a82e295146b0eeddea22bae58249aa7df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebc1db0f6eab6b6f44033a7eb5680577"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#aebc1db0f6eab6b6f44033a7eb5680577">XEmacPs_DecodeRxPDelayRespFollowUp</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:aebc1db0f6eab6b6f44033a7eb5680577"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to decode a received PTP PDelayRespFollowUp Packet.  <a href="#aebc1db0f6eab6b6f44033a7eb5680577">More...</a><br /></td></tr>
<tr class="separator:aebc1db0f6eab6b6f44033a7eb5680577"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59476f0ae545cbf058b54957fdc7e07e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a59476f0ae545cbf058b54957fdc7e07e">XEmacPs_DecodeRxSignaling</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a59476f0ae545cbf058b54957fdc7e07e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A function to decode a received PTP Signalling Packet.  <a href="#a59476f0ae545cbf058b54957fdc7e07e">More...</a><br /></td></tr>
<tr class="separator:a59476f0ae545cbf058b54957fdc7e07e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cb64af9fcb5c57ae91925f0dce913e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:a5cb64af9fcb5c57ae91925f0dce913e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is invoked to compare the Current Master clock's parameter with that of the PTP node's (own) and run Best Master Clock Algorithm.  <a href="#a5cb64af9fcb5c57ae91925f0dce913e8">More...</a><br /></td></tr>
<tr class="separator:a5cb64af9fcb5c57ae91925f0dce913e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac715c74d5783fba5952029ee1f47495e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#ac715c74d5783fba5952029ee1f47495e">XEmacPs_ReadAnnounceFrame</a> (u8 *PacketBuf, XEmacPs_BmcData *AnnounceFrame)</td></tr>
<tr class="memdesc:ac715c74d5783fba5952029ee1f47495e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is invoked from various places to extract clock information from a buffer and populate the XEmacPs_BmcData instance passed.  <a href="#ac715c74d5783fba5952029ee1f47495e">More...</a><br /></td></tr>
<tr class="separator:ac715c74d5783fba5952029ee1f47495e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4c50f19daf24df4decbc85f1d61b15f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame</a> (XEmacPs_Ieee1588 *InstancePtr, u8 *PacketBuf)</td></tr>
<tr class="memdesc:ac4c50f19daf24df4decbc85f1d61b15f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is invoked when a new Announce frame is received.  <a href="#ac4c50f19daf24df4decbc85f1d61b15f">More...</a><br /></td></tr>
<tr class="separator:ac4c50f19daf24df4decbc85f1d61b15f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04f921bc74c57957d0f619c5e0d51525"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a04f921bc74c57957d0f619c5e0d51525">XEmacPs_BestMasterClockAlgorithm</a> (XEmacPs_BmcData *AnnounceFrame, XEmacPs_BmcData *CurrentBmc)</td></tr>
<tr class="memdesc:a04f921bc74c57957d0f619c5e0d51525"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function will accept the data pointer to the current BMCA records, accept a pointer to an equivalent data structure for the new Announce Packet.  <a href="#a04f921bc74c57957d0f619c5e0d51525">More...</a><br /></td></tr>
<tr class="separator:a04f921bc74c57957d0f619c5e0d51525"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ef4aded60e6675acd3171bc8b9a1180"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a5ef4aded60e6675acd3171bc8b9a1180">XEmacPs_UpdateBmcRecords</a> (XEmacPs_BmcData *NewMaster, XEmacPs_BmcData *CurrentBmc)</td></tr>
<tr class="memdesc:a5ef4aded60e6675acd3171bc8b9a1180"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function updates the PTP master records (BMC records) with incoming BMC data.  <a href="#a5ef4aded60e6675acd3171bc8b9a1180">More...</a><br /></td></tr>
<tr class="separator:a5ef4aded60e6675acd3171bc8b9a1180"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7fbadddb7215b989727735f5721f776"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster</a> (XEmacPs_Ieee1588 *InstancePtr, u8 txAnnounceHasWon)</td></tr>
<tr class="memdesc:af7fbadddb7215b989727735f5721f776"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when the PTP node becomes RTC or PTP Master.  <a href="#af7fbadddb7215b989727735f5721f776">More...</a><br /></td></tr>
<tr class="separator:af7fbadddb7215b989727735f5721f776"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee2651d3170f826e60adf481c63b5c25"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#aee2651d3170f826e60adf481c63b5c25">XEmacPs_BecomeRtcSlave</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:aee2651d3170f826e60adf481c63b5c25"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called when the PTP node becomes PTP Slave.  <a href="#aee2651d3170f826e60adf481c63b5c25">More...</a><br /></td></tr>
<tr class="separator:aee2651d3170f826e60adf481c63b5c25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3eadb10f5bb3b62179164480fd3b8a19"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a3eadb10f5bb3b62179164480fd3b8a19">XEmacPs_ChangePeerIeee1588v2Capability</a> (XEmacPs_Ieee1588 *InstancePtr, u8 Capable)</td></tr>
<tr class="memdesc:a3eadb10f5bb3b62179164480fd3b8a19"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called to change the Peer capability of processing Iee1588v2 specific frames, e.g.  <a href="#a3eadb10f5bb3b62179164480fd3b8a19">More...</a><br /></td></tr>
<tr class="separator:a3eadb10f5bb3b62179164480fd3b8a19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f4210de351a167207f0370768de700a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a1f4210de351a167207f0370768de700a">XEmacPs_CalcDelay</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a1f4210de351a167207f0370768de700a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is called to calculate the link delay.  <a href="#a1f4210de351a167207f0370768de700a">More...</a><br /></td></tr>
<tr class="separator:a1f4210de351a167207f0370768de700a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae5766294dc1c8b2a62c124dd08e2d526"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#ae5766294dc1c8b2a62c124dd08e2d526">XEmacPs_CalcRtcOffset</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:ae5766294dc1c8b2a62c124dd08e2d526"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function calculates the Slave Offset from the GrandMaster time.  <a href="#ae5766294dc1c8b2a62c124dd08e2d526">More...</a><br /></td></tr>
<tr class="separator:ae5766294dc1c8b2a62c124dd08e2d526"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ef3c12b38b0a4fabf70678f08267aea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xemacps__ieee1588_8c.html#a4ef3c12b38b0a4fabf70678f08267aea">XEmacPs_UpdateRtcIncrement</a> (XEmacPs_Ieee1588 *InstancePtr)</td></tr>
<tr class="memdesc:a4ef3c12b38b0a4fabf70678f08267aea"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function clock rate adjustment.  <a href="#a4ef3c12b38b0a4fabf70678f08267aea">More...</a><br /></td></tr>
<tr class="separator:a4ef3c12b38b0a4fabf70678f08267aea"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="af7fbadddb7215b989727735f5721f776"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7fbadddb7215b989727735f5721f776">&#9670;&nbsp;</a></span>XEmacPs_BecomeRtcMaster()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_BecomeRtcMaster </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>txAnnounceHasWon</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called when the PTP node becomes RTC or PTP Master. </p>
<p>This will make any adjustments needed when the node becomes the Grand Master, including resetting the RTC to its nominal value</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">txAnnounceHasWon</td><td>if 1, indicates that this function has been called from the function <a class="el" href="xemacps__ieee1588_8c.html#a5cb64af9fcb5c57ae91925f0dce913e8" title="This function is invoked to compare the Current Master clock&#39;s parameter with that of the PTP node&#39;s ...">XEmacPs_DecodeTxAnnounceFrame()</a>. This way it can avoid performing things that are already done.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="group__emacps__v3__1.html#gaf347ab9a97d2aa70b8db20a5cdc6ca0b">XEMACPS_1588_INC_OFFSET</a>, <a class="el" href="xemacps__ieee1588_8c.html#ac715c74d5783fba5952029ee1f47495e">XEmacPs_ReadAnnounceFrame()</a>, <a class="el" href="xemacps__ieee1588_8h.html#adfd0ae3fd37438b0c459347d8001ee50">XEmacPs_TsuCalcClk()</a>, <a class="el" href="xemacps__ieee1588_8c.html#a5ef4aded60e6675acd3171bc8b9a1180">XEmacPs_UpdateBmcRecords()</a>, and <a class="el" href="group__emacps__v3__1.html#ga372948c9677f6859b62e87504fb2460e">XEmacPs_WriteReg</a>.</p>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData()</a>.</p>

</div>
</div>
<a id="aee2651d3170f826e60adf481c63b5c25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee2651d3170f826e60adf481c63b5c25">&#9670;&nbsp;</a></span>XEmacPs_BecomeRtcSlave()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_BecomeRtcSlave </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called when the PTP node becomes PTP Slave. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a04f921bc74c57957d0f619c5e0d51525"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04f921bc74c57957d0f619c5e0d51525">&#9670;&nbsp;</a></span>XEmacPs_BestMasterClockAlgorithm()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XEmacPs_BestMasterClockAlgorithm </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_BmcData *&#160;</td>
          <td class="paramname"><em>AnnounceFrame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_BmcData *&#160;</td>
          <td class="paramname"><em>CurrentBmc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function will accept the data pointer to the current BMCA records, accept a pointer to an equivalent data structure for the new Announce Packet. </p>
<p>TheBest Master Clock Algorithm (BMCA) is then performed on these two data structures by comparing the data fields</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AnnounceFrame</td><td>of the received new frame </td></tr>
    <tr><td class="paramname">CurrentBmc</td><td>is the existing BMC records</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
<a id="a1f4210de351a167207f0370768de700a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f4210de351a167207f0370768de700a">&#9670;&nbsp;</a></span>XEmacPs_CalcDelay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_CalcDelay </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called to calculate the link delay. </p>
<p>This is called after a complete sequence of PDelay packets. The PTP node sends a PDelayReq packet to start. Afterwards it receives the PDelayResp and PDelayRespFollowUp frames. Upon receiving the PDelayRespFollowUp, this function is invoked to calculate the link delay.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="ae5766294dc1c8b2a62c124dd08e2d526"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5766294dc1c8b2a62c124dd08e2d526">&#9670;&nbsp;</a></span>XEmacPs_CalcRtcOffset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_CalcRtcOffset </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function calculates the Slave Offset from the GrandMaster time. </p>
<p>It is called after receiving a Sync and FollowUp frame pair.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a3eadb10f5bb3b62179164480fd3b8a19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3eadb10f5bb3b62179164480fd3b8a19">&#9670;&nbsp;</a></span>XEmacPs_ChangePeerIeee1588v2Capability()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_ChangePeerIeee1588v2Capability </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Capable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is called to change the Peer capability of processing Iee1588v2 specific frames, e.g. </p>
<p>PDelayReq, PDelayResp etc. A peer is Ieee1588v2 capable when it is able to send PDelayReq frames or able to respond to PDelayReq frames.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">capable</td><td>is Peer's capability</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#a82e295146b0eeddea22bae58249aa7df">XEmacPs_DecodeRxPDelayResp()</a>, and <a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData()</a>.</p>

</div>
</div>
<a id="ac4c50f19daf24df4decbc85f1d61b15f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4c50f19daf24df4decbc85f1d61b15f">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxAnnounceFrame()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is invoked when a new Announce frame is received. </p>
<p>This function first reads the Announce frame parameters. If it is found that the announce frame has been received from the PTP master then the records are updated with the clock parameters. The Best Master Clock Algorithm is run in case any of the parameters in the announce frame has changed. There can be cases when the PTP master reduces its clock priority that may force the current PTP node to become master. If the PTP node is master and it has received this announce frame, then BMCA is run and if the incoming clock parameters are better tyhan that of the present node, the present node becomes SLAVE.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the Announce Frame.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8c.html#a04f921bc74c57957d0f619c5e0d51525">XEmacPs_BestMasterClockAlgorithm()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a3047658e5d93cf96bc6eb8216d81a6fd">XEmacPs_CompareClockIdentity()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity()</a>, <a class="el" href="xemacps__ieee1588_8c.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>, <a class="el" href="xemacps__ieee1588_8c.html#ac715c74d5783fba5952029ee1f47495e">XEmacPs_ReadAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588_8c.html#a5ef4aded60e6675acd3171bc8b9a1180">XEmacPs_UpdateBmcRecords()</a>.</p>

</div>
</div>
<a id="a696297bb61249e62e6901699128548c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a696297bb61249e62e6901699128548c6">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxFollowUp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxFollowUp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to decode a received PTP FollowUp Packet. </p>
<p>If the PTP node is master, source port identity of the received FollowUp frame matches that with this node's source port identity, the sequence Id of the received folowup frame matches that of last received Sync frame sequence Id, the function XEmacPs_CalcRtcOffset is invoked to calculate clock offset. Similalry for every 2 sync frames clock rate adjustment is done by calling XEmacPs_UpdateRtcIncrement. However, as of now, this function is not implemented and is empty.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the followup packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The clock rate adjustment is not implemented as of now. Though the function XEmacPs_UpdateRtcIncrement is called from here, the function does nothing! </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a3674aa1b8a9b3b0bd90b5651a7cb98f9">XEmacPs_GetSequenceId()</a>.</p>

</div>
</div>
<a id="a82e295146b0eeddea22bae58249aa7df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a82e295146b0eeddea22bae58249aa7df">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxPDelayResp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxPDelayResp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to decode a received PTP PDelayResp Packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the PDelayResp packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8c.html#a3eadb10f5bb3b62179164480fd3b8a19">XEmacPs_ChangePeerIeee1588v2Capability()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity()</a>.</p>

</div>
</div>
<a id="aebc1db0f6eab6b6f44033a7eb5680577"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aebc1db0f6eab6b6f44033a7eb5680577">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxPDelayRespFollowUp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxPDelayRespFollowUp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to decode a received PTP PDelayRespFollowUp Packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the PDelayRespFollowUp packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a3674aa1b8a9b3b0bd90b5651a7cb98f9">XEmacPs_GetSequenceId()</a>.</p>

</div>
</div>
<a id="a59476f0ae545cbf058b54957fdc7e07e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59476f0ae545cbf058b54957fdc7e07e">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxSignaling()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxSignaling </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to decode a received PTP Signalling Packet. </p>
<p>Empty as of now.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the signalling packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a52690e55087c8f5cb908d111c7431552"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52690e55087c8f5cb908d111c7431552">&#9670;&nbsp;</a></span>XEmacPs_DecodeRxSync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeRxSync </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to decode a received PTP Sync Packet. </p>
<p>It extracts the sync frame time stamp and stores it in appropriate buffer. It stores the sequence ID as well.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the sync packet.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#ab7f2340f7993c4f0702f32f5e9e413ba">XEmacPs_ComparePortIdentity()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity()</a>, <a class="el" href="xemacps__ieee1588_8h.html#a3674aa1b8a9b3b0bd90b5651a7cb98f9">XEmacPs_GetSequenceId()</a>, <a class="el" href="group__emacps__v3__1.html#ga2c048732ffe1aed7b1bb1205f59c1c21">XEMACPS_PTP_RXNANOSEC_OFFSET</a>, <a class="el" href="group__emacps__v3__1.html#gae458d2b51a3292478962726e4884f6e9">XEMACPS_PTP_RXSEC_OFFSET</a>, and <a class="el" href="group__emacps__v3__1.html#ga81a4d6db864dea35b8ddd690f7615539">XEmacPs_ReadReg</a>.</p>

</div>
</div>
<a id="a5cb64af9fcb5c57ae91925f0dce913e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5cb64af9fcb5c57ae91925f0dce913e8">&#9670;&nbsp;</a></span>XEmacPs_DecodeTxAnnounceFrame()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_DecodeTxAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is invoked to compare the Current Master clock's parameter with that of the PTP node's (own) and run Best Master Clock Algorithm. </p>
<p>A typical scenario is a new Announce frame has been received from the PTP Master and the PTP master record has been updated. Then this function is invoked to run Best Master Clock Algorithm with the PTP node's Announce Frame parameters and Current PTP Master's parameter.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>is the buffer that contains the Announce Frame. For this function the buffer passed is the Tx Announce Frame stored in the buffer AnnounceFrmToTx in XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8c.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster()</a>, <a class="el" href="xemacps__ieee1588_8c.html#a04f921bc74c57957d0f619c5e0d51525">XEmacPs_BestMasterClockAlgorithm()</a>, <a class="el" href="xemacps__ieee1588_8c.html#ac715c74d5783fba5952029ee1f47495e">XEmacPs_ReadAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588_8c.html#a5ef4aded60e6675acd3171bc8b9a1180">XEmacPs_UpdateBmcRecords()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588__example_8c.html#a9aae1b911dbc718a33b33b97fa7ac4e8">XEmacPs_InitializeProtocolData()</a>.</p>

</div>
</div>
<a id="ab9f6dd2305bed120624b1c3cdfff2212"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9f6dd2305bed120624b1c3cdfff2212">&#9670;&nbsp;</a></span>XEmacPs_MasterSendAnnounce()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_MasterSendAnnounce </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP Announce Packet. </p>
<p>The sequence Id of the announce frame is incremented before initiating the Tx.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#acef839505ebb9e7e3ac182d06a42a25e">XEmacPs_IncSequenceId()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a4c91eead95c645071cc2df1e36109de7">XEmacPs_PtpTxPacket()</a>.</p>

</div>
</div>
<a id="a56825a59cb3c1c705cb41d9da915ee88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56825a59cb3c1c705cb41d9da915ee88">&#9670;&nbsp;</a></span>XEmacPs_MasterSendFollowUp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_MasterSendFollowUp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP FOLLOWUP Packet. </p>
<p>Updates the correction field in the buffer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The correction field is hard coded to zero as of now. </dd></dl>

</div>
</div>
<a id="a3e54e6fc47b0af0a0a3bae8a6e0c0616"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e54e6fc47b0af0a0a3bae8a6e0c0616">&#9670;&nbsp;</a></span>XEmacPs_MasterSendSync()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_MasterSendSync </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP SYNC Packet. </p>
<p>The sequence Id of the announce frame is incremented before initiating the Tx.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a24b724fc0f49b35cb48284662f47ff38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24b724fc0f49b35cb48284662f47ff38">&#9670;&nbsp;</a></span>XEmacPs_PtpTxDoFurtherProcessing()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_PtpTxDoFurtherProcessing </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is invoked from the TxDone callback. </p>
<p>For sync frame it obtains the time stamp and populates the FollowUp frame Tx buffer. For PDelayReq and PDelayResp frames it obtains the time stamp and stores it is appropriate buffers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePntr</td><td>is a pointer to the instance of the XEmacPs_Ieee1588. </td></tr>
    <tr><td class="paramname">PacketBuf</td><td>which contains the buffer just transmitted</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#a63a23dce0edb87eb919ae03f814d9615">XEmacPs_GetMsgType()</a>.</p>

</div>
</div>
<a id="ac715c74d5783fba5952029ee1f47495e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac715c74d5783fba5952029ee1f47495e">&#9670;&nbsp;</a></span>XEmacPs_ReadAnnounceFrame()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_ReadAnnounceFrame </td>
          <td>(</td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>PacketBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_BmcData *&#160;</td>
          <td class="paramname"><em>AnnounceFrame</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is invoked from various places to extract clock information from a buffer and populate the XEmacPs_BmcData instance passed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PacketBuf</td><td>from which the clock information is extracted </td></tr>
    <tr><td class="paramname">AnnounceFrame</td><td>which is populated with clock information</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#ad20603083c71d3be8253e3bfb869c5b8">XEmacPs_GetPortIdentity()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
<a id="a493b403b2f9babe7778c9ef4f37dbe54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a493b403b2f9babe7778c9ef4f37dbe54">&#9670;&nbsp;</a></span>XEmacPs_SendPDelayReq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_SendPDelayReq </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP PDelayReq Packet. </p>
<p>The sequence Id of the announce frame is incremented before initiating the Tx.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xemacps__ieee1588_8h.html#acef839505ebb9e7e3ac182d06a42a25e">XEmacPs_IncSequenceId()</a>.</p>

</div>
</div>
<a id="a1d4609324a39c5ef322d3fa14d4e6bd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d4609324a39c5ef322d3fa14d4e6bd8">&#9670;&nbsp;</a></span>XEmacPs_SendPDelayResp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_SendPDelayResp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP PDelayResp Packet. </p>
<p>This function is invoked upon receiving a PDelayReq frame. It first gets the time stamps of the received PDelayReq from the hardware and stores them at appropriate entries in the structure instance PtpRecords. It then formats the PDelayResp frame with these time stamp values.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a2b2dafd9729d2c3e6c0d8fbe63e16ff9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b2dafd9729d2c3e6c0d8fbe63e16ff9">&#9670;&nbsp;</a></span>XEmacPs_SendPDelayRespFollowUp()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_SendPDelayRespFollowUp </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A function to format and then initiate the Tx of a PTP PDelayRespFollowUp Packet. </p>
<p>This function is invoked after a PDelayResp is successfully sent out (Tx done interrupt is received for PDelayResp packet). It populates the PDelayRespFollowUp frame with time stamps of the just transmitted PDelayResp packet.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="a5ef4aded60e6675acd3171bc8b9a1180"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ef4aded60e6675acd3171bc8b9a1180">&#9670;&nbsp;</a></span>XEmacPs_UpdateBmcRecords()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_UpdateBmcRecords </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_BmcData *&#160;</td>
          <td class="paramname"><em>NewMaster</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XEmacPs_BmcData *&#160;</td>
          <td class="paramname"><em>CurrentBmc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function updates the PTP master records (BMC records) with incoming BMC data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">NewMaster</td><td>is the new data to be updated </td></tr>
    <tr><td class="paramname">CurrentBmc</td><td>is the existing BMC records that needs to be updated.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xemacps__ieee1588_8h.html#af7fbadddb7215b989727735f5721f776">XEmacPs_BecomeRtcMaster()</a>, <a class="el" href="xemacps__ieee1588_8h.html#ac4c50f19daf24df4decbc85f1d61b15f">XEmacPs_DecodeRxAnnounceFrame()</a>, and <a class="el" href="xemacps__ieee1588_8h.html#a5cb64af9fcb5c57ae91925f0dce913e8">XEmacPs_DecodeTxAnnounceFrame()</a>.</p>

</div>
</div>
<a id="a4ef3c12b38b0a4fabf70678f08267aea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ef3c12b38b0a4fabf70678f08267aea">&#9670;&nbsp;</a></span>XEmacPs_UpdateRtcIncrement()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XEmacPs_UpdateRtcIncrement </td>
          <td>(</td>
          <td class="paramtype">XEmacPs_Ieee1588 *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function clock rate adjustment. </p>
<p>Not implemented as of now.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XEmacPs_Ieee1588 instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
